<!DOCTYPE html>
<html lang="zh">
<head>
	<meta charset="utf-8">
	<title>管理后台 - ${site.name}</title>
	<link rel="stylesheet"   href="${res}/plugins/layui/css/layui.css">
	<link href="${res}/themes/css/core.css?0423" rel="stylesheet" media="screen"/>
	<link href="${res}/themes/css/print.css" rel="stylesheet" media="print"/>
	<link href="${res}/font-awesome/css/font-awesome.min.css" rel="stylesheet" >
	<!--[if IE 7]>
	<link href="${res}/font-awesome/css/font-awesome-ie7.min.css" rel="stylesheet" >
	<![endif]-->
	<!--[if lte IE 9]>
		<link href="${res}/themes/css/ieHack.css" rel="stylesheet" media="screen"/>
		<script src="${res}/js/html5shiv.min.js"></script>
		<script src="${res}/js/respond.min.js"></script>
	<![endif]-->
	<script src="${res}/js/jquery-1.9.1.min.js"></script>
	<script src="${res}/js/jquery.cookie.js"></script>
	<script src="${res}/js/jquery.validate.js"></script>
	<script src="${res}/js/jquery.bgiframe.js"></script>

	<script type="text/javascript" src="${res}/plugins/layui/layui.js"></script>

	<script>var base="${base}/admin";</script>
	<script src="${res}/ueditor/ueditor.config.js"></script>
	<script src="${res}/ueditor/ueditor.all.min.js"></script>
	<script src="${res}/ueditor/lang/zh-cn/zh-cn.js"></script>

	<script src="${res}/js/dwz.min.js?042301"></script>
	<script src="${res}/js/dwz.regional.zh.js"></script>

	<link href="${res}/codemirror/lib/codemirror.css" rel="stylesheet" type="text/css" />
	<script src="${res}/codemirror/lib/codemirror.js"></script>
	<script src="${res}/codemirror/mode/xml/xml.js"></script>
	<script src="${res}/codemirror/mode/javascript/javascript.js"></script>
	<script src="${res}/codemirror/mode/css/css.js"></script>
	<script src="${res}/codemirror/mode/htmlmixed/htmlmixed.js"></script>
	<script src="${res}/codemirror/mode/freemarker/freemarker.js"></script>
	<script src="${res}/codemirror/mode/freemarkermixed/freemarkermixed.js"></script>
	<script src="${res}/codemirror/mode/nginx/nginx.js"></script>
	<script>
$(function(){
	DWZ.init("${res}/dwz.frag.html", {
		loginUrl:"login_dialog.html", loginTitle:"登录",
		pageInfo:{pageNum:"pageNum", numPerPage:"numPerPage", orderField:"orderField", orderDirection:"orderType"}, //【可选】
		debug:false,	// 调试模式 【true|false】
		callback:function(){
			initEnv();
			$("#themeList").theme({themeBase:"${res}/themes",defaultTheme:"default",version:"0424"}); // themeBase 相对于index页面的主题base路径
		}
	});
});
	</script>
</head>
<body scroll="no"  class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
	<div class="layui-header " style="z-index: 1;">
		<div class="layui-logo" style="background: #499788;color: #f2f2f2; font-size: 20px;">JoyConn CMS</div>
		<a href="javascript:;" class="layui-hide-xs"><div class="sykSwitchMenu"><i class="icon icon-indent-left" style="    font-size: 17px;"></i></div></a>
		<!-- 头部区域（可配合layui已有的水平导航） -->
		<!-- top left   -->

		<ul class="layui-nav layui-layout-left admin-top-menu" id="navMenu"	lay-filter="adminTopMenu" style="margin-left: 30px;">
			<@_sysMoudleList>
				<#list page.list as a>
					<@t.merge 'moudleIds' a.id!/>
				</#list>
				<@_sysRoleMoudle roleIds=admin.roles moudleIds=t.moudleIds!><#assign roleMoudleMap=map!/></@_sysRoleMoudle>

				<#list page.list as a>
					<#if (roleMoudleMap[a.id?string])??&&roleMoudleMap[a.id?string]>
						<#if !parentId?has_content><#assign parentId=a.id/></#if>
							<li class="layui-nav-item "><a href="${a.url?has_content?then(a.url,'menus.html?parentId='+a.id)}">${(a.attached?no_esc)!} <cite>${a.name}</cite></a></li>
					</#if>
				</#list>
			</@_sysMoudleList>
			<@_masterSite>
				<@_sysAuthorized roleIds=admin.roles url='sysSite/menu'>
					<li class="layui-nav-item "><a href="sysSite/menu.html"><i class="icon-sitemap icon-large"></i> <cite>站点管理</cite></a></li>
				</@_sysAuthorized>
			</@_masterSite>
		</ul>
		<script>$('#navMenu li:eq(0)').addClass("layui-this");</script>
		<!-- top right  -->
		<ul class="layui-nav layui-layout-right">
			<li class="layui-nav-item"><a href="" target="_blank" title="" class="righet_top_cur_site_a"><i class="layui-icon">&#xe68e;</i>网站首页</a></li>
			<@_sysAuthorized roleIds=admin.roles url='clearCache'>
				<li class="layui-nav-item"><a href="clearCache" target="ajaxTodo"><i class="icon-refresh icon-large"></i> 刷新缓存</a></li>
			</@_sysAuthorized>
			<li class="layui-nav-item">
				<a href="javascript:void(0)">选择站点</a>
				<@_sysSiteListByUser uid=admin.id>
				<dl class="layui-nav-child switch_site_btn_right_top">
					<#list sysSites as a>
						<#if !(a.disabled)>
							<dd class="${( a.id == site.id ) ?string( 'layui-this','' )}">
								<a href="javascript:jumpToSite('${a.sitePath!}')" title="${a.name!}"  >
									${a.name!}
								</a>
							</dd>
						</#if>
					</#list>
				</dl>
				</@_sysSiteListByUser>
			</li>
			<li class="layui-nav-item"><a href="javascript:;"> <i class="icon-user icon-large"></i> ${(admin.nickName)!}</a>
				<dl class="layui-nav-child">
					<dd>
						<a href="logout"><i class="icon-signout icon-large"></i> 退出</a>
					</dd>
				</dl>
			</li>
		</ul>
	</div>

	<div class="layui-side layui-bg-cyan ">
		<div id="leftside">
			<div id="sidebar_s">
				<a href="javascript:;" onclick="return false;"><i class="icon-reorder icon-large"></i></a>
			</div>
			<div id="sidebar">
				<div id="menu">
					<#include "menus.html"/>
				</div>
				<!--<div class="collapse">-->
					<!--<a href="javascript:;" onclick="return false;" class="toggleCollapse"><i class="icon icon-chevron-sign-left icon-large"></i></a>-->
				<!--</div>-->
			</div>
		</div>
	</div>
	<div class="layui-body"  style="z-index: 0;">
		<div id="navTab" class="tabsPage">
			<div class="tabsPageHeader">
				<div class="tabsPageHeaderContent">
					<ul class="navTab-tab">
						<li tabid="main" class="main"><a href="javascript:;" onclick="return false;"><i class="icon-home icon-large"></i> 工作台</a></li>
					</ul>
				</div>
				<a href="javascript:;" onclick="return false;" class="tabsLeft"><i class="icon-backward icon-large"></i></a>
				<a href="javascript:;" onclick="return false;" class="tabsRight"><i class="icon-forward icon-large"></i></a>
				<a href="javascript:;" onclick="return false;" class="tabsMore"><i class="icon-th-list icon-large"></i></a>
			</div>
			<ul class="tabsMoreList">
				<li><a href="javascript:;" onclick="return false;"><i class="icon-home icon-large"></i> 工作台</a></li>
			</ul>
			<div class="navTab-panel tabsPageContent layoutBox">
				<div class="page unitBox">
					<#include "main.html"/>
				</div>
			</div>
		</div>
	</div>
	<div class="layui-footer"  style="z-index: 0;">
				<!-- 底部固定区域 -->
				<div class="layui-row">
					<div class="layui-col-md11">
						Copyright &copy; ${.now?string('yyyy')}
					</div>
					<div class="layui-col-md1">
						<@_version><#if businessEdition>商业版授权</#if></@_version>
			</div>

</div>



<script type="text/javascript">
	// function showMySiteToTopNative(){
     //    $.post("sysSite/getMySites",{},function (result) {
     //        if(result){
     //            // var data = JSON.parse(result);
     //            var data = result;
     //            var curSite ;
     //            if(data.curSite){
     //                var model = data.curSite;
     //                curSite = data.curSite;
     //                $('.righet_top_cur_site_a').attr("title",model.name).attr("href",model.useStatic?model.sitePath:model.dynamicPath);
	// 			}
     //            $('.switch_site_btn_right_top dd').remove();
     //            $(data.sysSites).each(function (i,model) {
     //                if(!model.disabled){
     //                    $('.switch_site_btn_right_top').append('<dd><a href="'+(model.useStatic?model.sitePath:model.dynamicPath)+'/admin/" title="'+model.name+'">'+(curSite&& model.id==curSite.id? '<i class="icon icon-check" style="padding-right: 5px;" ></i>':'')+model.name+'</a></dd>');
	// 				}
     //            })
     //        }
     //    })
	// }
    function jumpToSite(path){
       var url = path.substr(2);
       var index = url.indexOf(":");
       if( index >-1){
           url = url.substr(0,index);
       }
        index = url.indexOf("/");
        if( index >-1){
            url = url.substr(0,index);
        }
        window.location=window.location.protocol+"//"+url+(window.location.port!=80?(":"+window.location.port):'')+"/admin"
    }
	$(function () {
       // showMySiteToTopNative();
        /**
         * 主页面
         *
         * @author: OF
         * @version 1.0.0
         */
        layui.use(['element'], function(){
            var element = layui.element;



            //菜单绑定

            $(".sykSwitchMenu").on("click",function(){
                if($(this).find("i.icon-indent-right").length>0){
                    $(this).find("i").removeClass("icon-indent-right").addClass("icon-indent-left");
                }else{
                    $(this).find("i").removeClass("icon-indent-left").addClass("icon-indent-right");
                }
                $(".layui-layout-admin").toggleClass("hiddenMenu");
            });
            /**
             * 左侧菜单点再关闭其它
             */
            $(".layui-side .layui-nav-item").click(function(){
                $(".layui-side .layui-nav-item").removeClass("layui-nav-itemed");
                $(".layui-side .layui-nav-item").removeClass("layui-this");
                if($(this).has('dl').length){//如果有子菜单，显示下拉样式
                    $(this).addClass("layui-nav-itemed");
                }else{//如果没有子菜单，显示菜单项样式
                    $(this).addClass("layui-this");
                }
            });






        });
	});

</script>
</body>
</html>